<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var age = prompt('请输入您的年龄');
      if (age == '' || age == null) {
        alert('用户未输入');
      }
    </script>
  </body>
</html>